

/*
  交易状态 0-待支付 1-已支付 2-已取消 3-失败
 */

export const tradeStateDict = [
  {code: 'WAIT_PAY', codeName: '待付款'},
  {code: 'PAY_OK', codeName: '已付款'},
  {code: 'CANCELL', codeName: '取消'},
  {code: 'FAIL', codeName: '失败'},
];


export function tradeStateGetName(code){
  for (let i = 0; i < tradeStateDict.length; i++) {
    if (tradeStateDict[i].code === code)
      return tradeStateDict[i].codeName;
  }

  return "未知";
}
